<template>
	<view style="width: 750rpx;height: 100%;background: #FFFFFF;overflow: hidden;">
		<view style="margin: 100rpx 0 0 66.44rpx;">
			<view style="width: 618.5rpx;height: 78.51rpx;">
				<input id="inp" type="text" value=""  v-model="yuanzheng_ma" placeholder="请设置密码"  style="width: 618.5rpx;height: 78.51rpx;background: #F5F5F5;box-sizing: border-box;padding: 20.77rpx 32rpx;font-size: 30.2rpx;"/>
			</view>
			<view style="margin-top: 49rpx;width: 618.5rpx;height: 78.51rpx;">
				<input id="inp" type="text" value=""  v-model="yuanzheng_er" placeholder="请再次确认密码"  style="width: 618.5rpx;height: 78.51rpx;background: #F5F5F5;box-sizing: border-box;padding: 20.77rpx 32rpx;font-size: 30.2rpx;" />
			</view>
			<view style="width: 618.5rpx;height: 78.51rpx;background: #EE7B30;text-align: center;line-height: 78.51rpx;font-size: 33.83rpx;color: #FFFFFF;font-weight: bold;letter-spacing: 3rpx;margin-top: 87rpx;border-radius: 6rpx;" @tap="login_">完成</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data(){
			return {
				user_id:"",
				shuju_dian:"",
				yanzheng:"",
				yuanzheng_ma:"",
				yuanzheng_er:""
			}
		},
		methods:{
		async	login_(){
			    let me = this
				if(me.yuanzheng_ma == ""){
					uni.showToast({
						title:"请填写密码",
						icon:"none"
					})
				}else if(me.yuanzheng_er == ""){
					uni.showToast({
						title:"请再次确认密码",
						icon:"none"
					})
				}else if(me.yuanzheng_ma != me.yuanzheng_er){
					uni.showToast({
						title:"两次密码不一致",
						icon:"none"
					})
				}else{
					const res = await me.$myRequest({
						url:"/user/update",
						methed:"post",
						data:{
							login_name:me.user_id,
							login_pass:me.yuanzheng_ma,
							is_teach_paypal:"true"
						},
						header:{
							"content-type":"application/json"
						}
					})
					if(res.code == 0){
						uni.navigateTo({
							url:"/pages/tabBer/login/logins"
						})
					}
				}
			}
		},
		onLoad(options) {
			let me = this
			me.user_id = options.num
		}
	}
</script>